package com.ideal.core.constant;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class Constant {

    private static  Properties res;
    static {
        try {
            res = new Properties();
            InputStream in = Constant.class.getClassLoader().getResourceAsStream("freemarker.properties");
            InputStreamReader inputStreamReader = new InputStreamReader(in,"gbk");
            res.load(inputStreamReader);

        }catch (Exception e){
            e.printStackTrace();
        }
    }

    /**
     * 实体类路径
     */
    public static String DOMAIN_PATH=res.getProperty("DOMAIN_PATH");
    public static String DAO_PATH=res.getProperty("DAO_PATH");
    public static String DAO_IMPL_PATH=res.getProperty("DAO_IMPL_PATH");
    public static String SERVICE_PATH=res.getProperty("SERVICE_PATH");
    public static String SERVICE_IMPL_PATH=res.getProperty("SERVICE_IMPL_PATH");
    public static String CONTROLLER_PATH=res.getProperty("CONTROLLER_PATH");

    public static String MAPPING_SUFFIX=".hbm.xml";
    public static String JAVA_FILE_SUFFIX=".java";
    public static String JSP_FILE_SUFFIX=".jsp";

    /**
     * 实体类文件名
     */
    public static String DOMAIN_CLASSNAME=res.getProperty("DOMAIN_CLASSNAME");
    public static String DAO_CLASSNAME=res.getProperty("DAO_CLASSNAME");
    public static String DAO_IMPL_CLASSNAME=res.getProperty("DAO_IMPL_CLASSNAME");
    public static String SERVICE_CLASSNAME=res.getProperty("SERVICE_CLASSNAME");
    public static String SERVICE_IMPL_CLASSNAME=res.getProperty("SERVICE_IMPL_CLASSNAME");
    public static String CONTROLLER_CLASSNAME=res.getProperty("CONTROLLER_CLASSNAME");

    /**
     * 实体类包名
     */
    public static String DOMAIN_PACKAGE=res.getProperty("DOMAIN_PACKAGE");
    public static String DAO_PACKAGE=res.getProperty("DAO_PACKAGE");
    public static String DAO_IMPL_PACKAGE=res.getProperty("DAO_IMPL_PACKAGE");
    public static String SERVICE_PACKAGE=res.getProperty("SERVICE_PACKAGE");
    public static String SERVICE_IMPL_PACKAGE=res.getProperty("SERVICE_IMPL_PACKAGE");
    public static String CONTROLLER_PACKAGE=res.getProperty("CONTROLLER_PACKAGE");


    /**
     * 常用类型名
     */
    public static String STRING = "java.lang.String";
    public static String DATE="java.util.Date";
    public static String OBJECT="java.lang.Object";

    /**
     * 常用字段
     */
    public static String SPACE=" ";
    public static String DOT=".";
    public static String PACKAGE="package";
    public static String PREFIX="I";
    public static String CLOSE=";";
    public static String IMPORT="import";

    /**
     * 类的类型
     */
    public static String DOMAIN = "domain";
    public static String DOMAIN_MAPPING="mapping";
    public static String DAO = "dao";
    public static String DAOIMPL = "daoImpl";
    public static String SERVICE = "service";
    public static String SERVICEIMPL = "serviceImpl";
    public static String CONTROLLER = "controller";
    public static String JSP_FORM="Form";
    public static String JSP_REVIEW="Review";


}
